/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AST;

/**
 *
 * @author Eddy
 */
public class Clave extends Instruccion{

    
   public String Clave; 
   public  boolean Sol=false;
   public  boolean Fa=false;
   public  boolean Do=false;
   public  boolean Re=false;
   
   public Clave(int l,int c,String clv)
   {
       NoLinea=l;
       Columna=c;
       Clave=clv;
   }
   public boolean CargarTS()
   {
       boolean res=true;
       if(this.Clave.equals("SOL")){this.Sol=true;}
       if(this.Clave.equals("FA")){ this.Fa=true;}
       if(this.Clave.equals("DO")){ this.Do=true;}
       if(this.Clave.equals("RE")){ this.Re=true;}
      if(Clave.equals("SOL")||Clave.equals("FA")||Clave.equals("DO")||Clave.equals("RE")){res=true;}
    else{Errores.InsertarError(NoLinea, Columna, " esta clave no existe: "+Clave+"\n");res=false;}
       return res;
   }
   
   public boolean Traduccion()
   {
    boolean res=true;
       
       if(this.Clave.equals("SOL")){Traduccion="KGmin "; this.Sol=true;}
       if(this.Clave.equals("FA")){Traduccion="KFmin "; this.Fa=true;}
       if(this.Clave.equals("DO")){Traduccion="KCmin "; this.Do=true;}
       if(this.Clave.equals("RE")){Traduccion="KDmin "; this.Re=true;}
       
       if(this.Clave.equals("SOL")){TraduccionABC4J="K:G\n ";}
       if(this.Clave.equals("FA")){TraduccionABC4J="K:F\n ";}
       if(this.Clave.equals("DO")){TraduccionABC4J="K:C\n ";}
       if(this.Clave.equals("RE")){TraduccionABC4J="K:D\n ";}
       
       
       return res;
   }
   
    
}
